home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / ftp / RCS / cmdtab.c,v < prev    next >
Encoding:
Text File  |  1990-10-27  |  9.3 KB  |  269 lines

  1. head     1.2;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.2
  10. date     90.10.27.13.48.36;  author shirriff;  state Exp;
  11. branches ;
  12. next     1.1;
  13.  
  14. 1.1
  15. date     90.10.27.13.45.16;  author shirriff;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19.  
  20. desc
  21. @@
  22.  
  23.  
  24. 1.2
  25. log
  26. @New revision.
  27. @
  28. text
  29. @/*
  30.  * Copyright (c) 1985, 1989 Regents of the University of California.
  31.  * All rights reserved.
  32.  *
  33.  * Redistribution and use in source and binary forms are permitted
  34.  * provided that the above copyright notice and this paragraph are
  35.  * duplicated in all such forms and that any documentation,
  36.  * advertising materials, and other materials related to such
  37.  * distribution and use acknowledge that the software was developed
  38.  * by the University of California, Berkeley.  The name of the
  39.  * University may not be used to endorse or promote products derived
  40.  * from this software without specific prior written permission.
  41.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  42.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  43.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  44.  */
  45.  
  46. #ifndef lint
  47. static char sccsid[] = "@@(#)cmdtab.c    5.9 (Berkeley) 3/21/89";
  48. #endif /* not lint */
  49.  
  50. #include "ftp_var.h"
  51.  
  52. /*
  53.  * User FTP -- Command Tables.
  54.  */
  55. int    setascii(), setbell(), setbinary(), setdebug(), setform();
  56. int    setglob(), sethash(), setmode(), setpeer(), setport();
  57. int    setprompt(), setstruct();
  58. int    settenex(), settrace(), settype(), setverbose();
  59. int    disconnect(), restart(), reget(), syst();
  60. int    cd(), lcd(), delete(), mdelete(), user();
  61. int    ls(), mls(), get(), mget(), help(), append(), put(), mput();
  62. int    quit(), renamefile(), status();
  63. int    quote(), rmthelp(), shell(), site();
  64. int    pwd(), makedir(), removedir(), setcr();
  65. int    account(), doproxy(), reset(), setcase(), setntrans(), setnmap();
  66. int    setsunique(), setrunique(), cdup(), macdef(), domacro();
  67. int    sizecmd(), modtime(), newer(), rmtstatus();
  68. int    do_chmod(), do_umask(), idle();
  69.  
  70. char    accounthelp[] =    "send account command to remote server";
  71. char    appendhelp[] =    "append to a file";
  72. char    asciihelp[] =    "set ascii transfer type";
  73. char    beephelp[] =    "beep when command completed";
  74. char    binaryhelp[] =    "set binary transfer type";
  75. char    casehelp[] =    "toggle mget upper/lower case id mapping";
  76. char    cdhelp[] =    "change remote working directory";
  77. char    cduphelp[] =     "change remote working directory to parent directory";
  78. char    chmodhelp[] =    "change file permissions of remote file";
  79. char    connecthelp[] =    "connect to remote tftp";
  80. char    crhelp[] =    "toggle carriage return stripping on ascii gets";
  81. char    deletehelp[] =    "delete remote file";
  82. char    debughelp[] =    "toggle/set debugging mode";
  83. char    dirhelp[] =    "list contents of remote directory";
  84. char    disconhelp[] =    "terminate ftp session";
  85. char    domachelp[] =     "execute macro";
  86. char    formhelp[] =    "set file transfer format";
  87. char    globhelp[] =    "toggle metacharacter expansion of local file names";
  88. char    hashhelp[] =    "toggle printing `#' for each buffer transferred";
  89. char    helphelp[] =    "print local help information";
  90. char    idlehelp[] =    "get (set) idle timer on remote side";
  91. char    lcdhelp[] =    "change local working directory";
  92. char    lshelp[] =    "list contents of remote directory";
  93. char    macdefhelp[] =  "define a macro";
  94. char    mdeletehelp[] =    "delete multiple files";
  95. char    mdirhelp[] =    "list contents of multiple remote directories";
  96. char    mgethelp[] =    "get multiple files";
  97. char    mkdirhelp[] =    "make directory on the remote machine";
  98. char    mlshelp[] =    "list contents of multiple remote directories";
  99. char    modtimehelp[] = "show last modification time of remote file";
  100. char    modehelp[] =    "set file transfer mode";
  101. char    mputhelp[] =    "send multiple files";
  102. char    newerhelp[] =    "get file if remote file is newer than local file ";
  103. char    nlisthelp[] =    "nlist contents of remote directory";
  104. char    nmaphelp[] =    "set templates for default file name mapping";
  105. char    ntranshelp[] =    "set translation table for default file name mapping";
  106. char    porthelp[] =    "toggle use of PORT cmd for each data connection";
  107. char    prompthelp[] =    "force interactive prompting on multiple commands";
  108. char    proxyhelp[] =    "issue command on alternate connection";
  109. char    pwdhelp[] =    "print working directory on remote machine";
  110. char    quithelp[] =    "terminate ftp session and exit";
  111. char    quotehelp[] =    "send arbitrary ftp command";
  112. char    receivehelp[] =    "receive file";
  113. char    regethelp[] =    "get file restarting at end of local file";
  114. char    remotehelp[] =    "get help from remote server";
  115. char    renamehelp[] =    "rename file";
  116. char    restarthelp[]=    "restart file transfer at bytecount";
  117. char    rmdirhelp[] =    "remove directory on the remote machine";
  118. char    rmtstatushelp[]="show status of remote machine";
  119. char    runiquehelp[] = "toggle store unique for local files";
  120. char    resethelp[] =    "clear queued command replies";
  121. char    sendhelp[] =    "send one file";
  122. char    sitehelp[] =    "send site specific command to remote server\n\t\tTry \"rhelp site\" or \"site help\" for more information";
  123. char    shellhelp[] =    "escape to the shell";
  124. char    sizecmdhelp[] = "show size of remote file";
  125. char    statushelp[] =    "show current status";
  126. char    structhelp[] =    "set file transfer structure";
  127. char    suniquehelp[] = "toggle store unique on remote machine";
  128. char    systemhelp[] =  "show remote system type";
  129. char    tenexhelp[] =    "set tenex file transfer type";
  130. char    tracehelp[] =    "toggle packet tracing";
  131. char    typehelp[] =    "set file transfer type";
  132. char    umaskhelp[] =    "get (set) umask on remote side";
  133. char    userhelp[] =    "send new user information";
  134. char    verbosehelp[] =    "toggle verbose mode";
  135.  
  136. struct cmd cmdtab[] = {
  137.     { "!",        shellhelp,    0,    0,    0,    shell },
  138.     { "$",        domachelp,    1,    0,    0,    domacro },
  139.     { "account",    accounthelp,    0,    1,    1,    account},
  140.     { "append",    appendhelp,    1,    1,    1,    put },
  141.     { "ascii",    asciihelp,    0,    1,    1,    setascii },
  142.     { "bell",    beephelp,    0,    0,    0,    setbell },
  143.     { "binary",    binaryhelp,    0,    1,    1,    setbinary },
  144.     { "bye",    quithelp,    0,    0,    0,    quit },
  145.     { "case",    casehelp,    0,    0,    1,    setcase },
  146.     { "cd",        cdhelp,        0,    1,    1,    cd },
  147.     { "cdup",    cduphelp,    0,    1,    1,    cdup },
  148.     { "chmod",    chmodhelp,    0,    1,    1,    do_chmod },
  149.     { "close",    disconhelp,    0,    1,    1,    disconnect },
  150.     { "cr",        crhelp,        0,    0,    0,    setcr },
  151.     { "delete",    deletehelp,    0,    1,    1,    delete },
  152.     { "debug",    debughelp,    0,    0,    0,    setdebug },
  153.     { "dir",    dirhelp,    1,    1,    1,    ls },
  154.     { "disconnect",    disconhelp,    0,    1,    1,    disconnect },
  155.     { "form",    formhelp,    0,    1,    1,    setform },
  156.     { "get",    receivehelp,    1,    1,    1,    get },
  157.     { "glob",    globhelp,    0,    0,    0,    setglob },
  158.     { "hash",    hashhelp,    0,    0,    0,    sethash },
  159.     { "help",    helphelp,    0,    0,    1,    help },
  160.     { "idle",    idlehelp,    0,    1,    1,    idle },
  161.     { "image",    binaryhelp,    0,    1,    1,    setbinary },
  162.     { "lcd",    lcdhelp,    0,    0,    0,    lcd },
  163.     { "ls",        lshelp,        1,    1,    1,    ls },
  164.     { "macdef",    macdefhelp,    0,    0,    0,    macdef },
  165.     { "mdelete",    mdeletehelp,    1,    1,    1,    mdelete },
  166.     { "mdir",    mdirhelp,    1,    1,    1,    mls },
  167.     { "mget",    mgethelp,    1,    1,    1,    mget },
  168.     { "mkdir",    mkdirhelp,    0,    1,    1,    makedir },
  169.     { "mls",    mlshelp,    1,    1,    1,    mls },
  170.     { "mode",    modehelp,    0,    1,    1,    setmode },
  171.     { "modtime",    modtimehelp,    0,    1,    1,    modtime },
  172.     { "mput",    mputhelp,    1,    1,    1,    mput },
  173.     { "newer",    newerhelp,    1,    1,    1,    newer },
  174.     { "nmap",    nmaphelp,    0,    0,    1,    setnmap },
  175.     { "nlist",    nlisthelp,    1,    1,    1,    ls },
  176.     { "ntrans",    ntranshelp,    0,    0,    1,    setntrans },
  177.     { "open",    connecthelp,    0,    0,    1,    setpeer },
  178.     { "prompt",    prompthelp,    0,    0,    0,    setprompt },
  179.     { "proxy",    proxyhelp,    0,    0,    1,    doproxy },
  180.     { "sendport",    porthelp,    0,    0,    0,    setport },
  181.     { "put",    sendhelp,    1,    1,    1,    put },
  182.     { "pwd",    pwdhelp,    0,    1,    1,    pwd },
  183.     { "quit",    quithelp,    0,    0,    0,    quit },
  184.     { "quote",    quotehelp,    1,    1,    1,    quote },
  185.     { "recv",    receivehelp,    1,    1,    1,    get },
  186.     { "reget",    regethelp,    1,    1,    1,    reget },
  187.     { "rstatus",    rmtstatushelp,    0,    1,    1,    rmtstatus },
  188.     { "rhelp",    remotehelp,    0,    1,    1,    rmthelp },
  189.     { "rename",    renamehelp,    0,    1,    1,    renamefile },
  190.     { "reset",    resethelp,    0,    1,    1,    reset },
  191.     { "restart",    restarthelp,    1,    1,    1,    restart },
  192.     { "rmdir",    rmdirhelp,    0,    1,    1,    removedir },
  193.     { "runique",    runiquehelp,    0,    0,    1,    setrunique },
  194.     { "send",    sendhelp,    1,    1,    1,    put },
  195.     { "site",    sitehelp,    0,    1,    1,    site },
  196.     { "size",    sizecmdhelp,    1,    1,    1,    sizecmd },
  197.     { "status",    statushelp,    0,    0,    1,    status },
  198.     { "struct",    structhelp,    0,    1,    1,    setstruct },
  199.     { "system",    systemhelp,    0,    1,    1,    syst },
  200.     { "sunique",    suniquehelp,    0,    0,    1,    setsunique },
  201.     { "tenex",    tenexhelp,    0,    1,    1,    settenex },
  202.     { "trace",    tracehelp,    0,    0,    0,    settrace },
  203.     { "type",    typehelp,    0,    1,    1,    settype },
  204.     { "user",    userhelp,    0,    1,    1,    user },
  205.     { "umask",    umaskhelp,    0,    1,    1,    do_umask },
  206.     { "verbose",    verbosehelp,    0,    0,    0,    setverbose },
  207.     { "?",        helphelp,    0,    0,    1,    help },
  208.     { 0 },
  209. };
  210.  
  211. int    NCMDS = (sizeof (cmdtab) / sizeof (cmdtab[0])) - 1;
  212. @
  213.  
  214.  
  215. 1.1
  216. log
  217. @Initial revision
  218. @
  219. text
  220. @d2 1
  221. a2 1
  222.  * Copyright (c) 1985 Regents of the University of California.
  223. d6 10
  224. a15 5
  225.  * provided that this notice is preserved and that due credit is given
  226.  * to the University of California at Berkeley. The name of the University
  227.  * may not be used to endorse or promote products derived from this
  228.  * software without specific prior written permission. This software
  229.  * is provided ``as is'' without express or implied warranty.
  230. d19 1
  231. a19 1
  232. static char sccsid[] = "@@(#)cmdtab.c    5.5 (Berkeley) 3/14/88";
  233. d31 1
  234. a31 1
  235. int    disconnect();
  236. d35 1
  237. a35 1
  238. int    quote(), rmthelp(), shell();
  239. d39 2
  240. d50 1
  241. d62 1
  242. d64 1
  243. a64 1
  244. char    lshelp[] =    "nlist contents of remote directory";
  245. d70 2
  246. a71 1
  247. char    mlshelp[] =    "nlist contents of multiple remote directories";
  248. d74 2
  249. d85 1
  250. d88 1
  251. d90 1
  252. d94 1
  253. d96 1
  254. d100 1
  255. d104 1
  256. d120 1
  257. d132 1
  258. d143 1
  259. d145 1
  260. d147 1
  261. d158 3
  262. a160 1
  263.     { "remotehelp",    remotehelp,    0,    1,    1,    rmthelp },
  264. d163 1
  265. d167 2
  266. d171 1
  267. d177 1
  268. @
  269.